<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"    
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/templatemapa.xhtml">
        <ui:define name="title">

        </ui:define>
        <ui:define name="body" > 
            <p:growl id="messages"  showDetail="true" />

            <h:outputLabel value="#{bundle.ListWebserviceTitle_empresa}" style="font-weight: bold" for="empresa" />
            <p:selectOneMenu value="#{mapaEstacaoController.empresa}" filter="true" filterMatchMode="contains"  id ="empresa"  >
                <f:selectItems value="#{orgaoController.itemsAvailableSelectOne}"/>
                <p:ajax listener="#{mapaEstacaoController.atualizaMapa}" update=":formList:mapa, :formList:panelMapa"/>
                <p:focus for="empresa"/>
            </p:selectOneMenu> 

            <p:panel id="panelMapa" header="#{bundle.titleGoogleEstacoesMaps}">

                <p:gmap id="mapa" center="#{bundle.centroDoMapa}" zoom="5" model="#{mapaEstacaoController.model}" 
                        type="TERRAIN" style="width:100%; height:650px;" widgetVar="tmap">    

                    <p:ajax event="overlaySelect" listener="#{mapaEstacaoController.onMarkerSelect}" />

                    <p:gmapInfoWindow >  
                        <p:outputPanel style="text-align:left; display:block; margin:auto;">  

                            <h:panelGrid columns="2" >                               

                                <p:outputLabel style="font-weight: bold;" value="#{bundle.ViewOrgaoLabel_orgCnpj}"/>
                                <h:outputText value="#{mapaEstacaoController.estacaoMapa.orgCnpj}" converter="inputConverter"/> 

                                <p:outputLabel style="font-weight: bold;" value="#{bundle.ViewOrgaoLabel_orgNm}"/>
                                <h:outputText value="(#{mapaEstacaoController.estacaoMapa.orgId}) #{mapaEstacaoController.estacaoMapa.orgNm}" /> 

                                <p:outputLabel style="font-weight: bold;" value="#{bundle.ViewEstacaoLabel_estNm}"/>
                                <h:outputText value="#{mapaEstacaoController.marker.title}" />

                                <p:outputLabel style="font-weight: bold;" value="#{bundle.ViewEstacaoLabel_estCdFlu}"/>
                                <h:outputText value="#{mapaEstacaoController.estacaoMapa.estCodigoAdicional}" />  

                                <p:outputLabel style="font-weight: bold;" value="#{bundle.ViewEstacaoLabel_estCdPlu}"/>
                                <h:outputText value="#{mapaEstacaoController.estacaoMapa.estAneelPlu}" /> 

                                <p:outputLabel style="font-weight: bold;" value="#{bundle.ViewUsinaLabel_usiLatitude}"/>
                                <h:outputText value="#{mapaEstacaoController.estacaoMapa.estLatitude}" >  
                                    <f:converter converterId="latLong" />
                                </h:outputText>
                                <p:outputLabel style="font-weight: bold;" value="#{bundle.ViewUsinaLabel_usiLongitude}"/>
                                <h:outputText value="#{mapaEstacaoController.estacaoMapa.estLongitude}" >
                                    <f:converter converterId="latLong" />
                                </h:outputText>                      

                                <p:outputLabel style="font-weight: bold;" value="#{bundle.ViewEstacaoLabel_estNuAltitude}"/>
                                <h:outputText value="#{mapaEstacaoController.estacaoMapa.estAltitude}" /> 

                               

                            </h:panelGrid>
                        </p:outputPanel>  

                    </p:gmapInfoWindow>  
                </p:gmap>        

            </p:panel>
            
            <p:ajaxStatus  onstart="statusDialog.show();" onsuccess="statusDialog.hide();"/>

            <p:dialog modal="true" widgetVar="statusDialog" header="#{bundle.headerAjaxStatus}" 
                      draggable="false" closable="false">
                <p:graphicImage value="#{bundle.loadingGif2}" />
            </p:dialog>
        </ui:define>
    </ui:composition>
</html>